package org.biblicalcontent.gbsbijbel.internal.entities;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.biblicalcontent.gbsbijbel.model.IBijbel;
import org.biblicalcontent.gbsbijbel.model.ITestament;

@Entity
@Table(name = "Bijbel", uniqueConstraints = @UniqueConstraint(columnNames = "naam"))
public class Bijbel implements IBijbel {

	@OneToMany
	private List<ITestament> testamenten;

	private String naam;

	public Bijbel(String naam, List<ITestament> testamenten) {
		this.naam = naam;
		this.testamenten = testamenten;
	}

	protected Bijbel() {

	}

	@Override
	public String getNaam() {
		return naam;
	}

	@Override
	public List<ITestament> getTestamenten() {
		return testamenten;
	}

	private void setTestamenten(List<ITestament> testamenten) {
		this.testamenten = testamenten;
	}

	private void setNaam(String naam) {
		this.naam = naam;
	}

	@Override
	public String toString() {
		return naam;
	}
}
